A. Field of the Invention
Embodiments of the invention generally relate to distributed computer systems and, more particularly, to methods and apparatus for packaging a computer program for remote execution.
B. Description of the Related Art
In today's society, the Internet has become an important medium for information exchange. Although the Internet is now very popular among the general public, it initially began as a system (or network) of interconnected computers used by government and academic researchers. An early problem of this network stemmed from the fact that the interconnected computers were not the same; they employed different hardware as well as different operating systems. Information exchange on such a heterogeneous network posed a communication problem. This problem was resolved through agreement on common standards, including protocols such as Transmission Control Protocol/Internet Protocol (TCP/IP) and HyperText Transfer Protocol (HTTP). These protocols enabled varied interconnected machines to share information in the form of static text or graphic documents.
These protocols, however, represented only two steps in the evolution of the Internet. Although users can exchange information documents among varied computers connected to the Internet, they cannot exchange executable application programs written in conventional languages such as C or C++, which are designed to interface with a particular processor (e.g., the Intel Pentium processor) and/or a particular operating system (e.g., Windows 95 or DOS). This problem was solved with the advent of the Java.TM. programming language and its related runtime system.
The Java programming language is an object-oriented programming language that is described, for example, in a text entitled "The Java.TM. Tutorial" by Mary Campione and Kalhy Walrath, Addison-Wesley, 1996..sup.1 Importantly, the Java programming language is an interpreted language that is platform-independent-that is, its utility is not limited to one particular computer system. Using the Java programming language, a software developer writes programs in a form commonly called Java source code. When the developer completes authoring the program, he then compiles it with a Java compiler into an intermediate form called bytecode. Both the Java source code and the bytecode are platform-independent. .sup.1
 FNT Sun, Sun Microsystems, the Sun Logo, Java, the Java Virtual Machine, and the Java Runtime Environment are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
The compiled bytecode can then be executed on any computer system that employs a compatible runtime system that includes a virtual machine (VM), such as the Java Runtime Environment (JRE) that includes the Java Virtual Machine (JVM) and Java class libraries. The JVM is described in a text entitled "The Java Virtual Machine Specification," by Tim Lindholm and Frank Yellin, Addison Wesley, 1996. The Java VM acts as an interpreter between the bytecode and the particular computer system being used. By use of platform-independent bytecode and the Java VM, a program written in the Java programming language can be executed on any computer system. This is particularly useful in networks such as the Internet that interconnect heterogeneous computer systems.
Before a Java program can be executed, certain requisite classes must be loaded into the memory of the computer executing the program. These classes may be loaded from the computer's disk, but are more commonly transferred across a network from a server. Customarily, these classes are loaded as late during the program's execution as possible; in otier words, they are loaded on-demand, when first referenced during the program's execution. When such loading occurs, it is also customary to load an entire class whenever any part of that class is necessary.
According to a conventional approach, when a user on a machine issues a request to execute the program resident on a remote server, the class file containing the main method is loaded from the server to the client across the network. This class file contains the program bytecode. The virtual machine then begins execution by invoking the main method of the program.
Execution continues until the program references a component, for example a component referred to as "F." In response to this reference, the entire class that contains component F is transferred from class files on the server to the client via the network. The referenced component F is used and execution then continues until another component, for example a component referred to as "G," is referenced. In response to this reference, the entire class containing component G is transferred from class files on the server to the client via the network. Execution then continues to completion. Once the execution has completed, the series of connections between the client and the server over the network may finally be terminated.
This description demonstrates two significant disadvantages with the conventional approach. First, it requires repeated connections between the client and the server throughout the course of program execution. Such a lengthy period during which connections must be made may be problematic for situations such as mobile computing. Second, whenever a component is referenced, for example, component F, this approach requires that the entire class containing that referenced component be loaded from the server. If, however, only a few of the components within the class are ultimately used, the bandwidth required to transfer the unused components from the server to the client has been wasted. This is problematic in situations involving limited bandwidth, i.e., slow connection speeds or high-latency connections, between the client and the server.
There is therefore a need for a system that alleviates these problems by packaging together only the necessary components of an entire program and delivering it to the client before execution begins. Prepackaging software for remote execution has been employed using other compiled computer languages requiring machine compatibility, such as Cobol, C and Fortran. It has not, however, been employed using an object-oriented languages, such as the Java programming language, which provide additional benefits, such as extracting necessary components from their parent classes.